'''
Created on Jan 17, 2010

@author: roman
'''


from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import users 
import logging

import feedreader

class CronJob(webapp.RequestHandler):
    def get(self):
        if self.request.get('action') != 'oldtweets':
            feedreader.readFeed()
        else:
            feedreader.fetchOldUpdates(handler=self)


def main():
    logging.getLogger().setLevel(logging.DEBUG)
    application = webapp.WSGIApplication([ 
                                          ('/cron', CronJob)
                                          ], debug=True)
    util.run_wsgi_app(application)


if __name__ == '__main__':
    main()
                                                          